Optimal. Leaf size=61 \[ \frac {2 B \sqrt {a-b} \sqrt {a+b} \tanh ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a^2 d}+\frac {b B x}{a^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.11, antiderivative size = 61, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3919, 3831, 2659, 208} \[ \frac {2 B \sqrt {a-b} \sqrt {a+b} \tanh ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a^2 d}+\frac {b B x}{a^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 208
Rule 2659
Rule 3831
Rule 3919
Rubi steps
\begin {align*} \int \frac {\frac {b B}{a}+B \sec (c+d x)}{a+b \sec (c+d x)} \, dx &=\frac {b B x}{a^2}-\frac {\left (-a B+\frac {b^2 B}{a}\right ) \int \frac {\sec (c+d x)}{a+b \sec (c+d x)} \, dx}{a}\\ &=\frac {b B x}{a^2}-\frac {\left (-a B+\frac {b^2 B}{a}\right ) \int \frac {1}{1+\frac {a \cos (c+d x)}{b}} \, dx}{a b}\\ &=\frac {b B x}{a^2}-\frac {\left (2 \left (-a B+\frac {b^2 B}{a}\right )\right ) \operatorname {Subst}\left (\int \frac {1}{1+\frac {a}{b}+\left (1-\frac {a}{b}\right ) x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{a b d}\\ &=\frac {b B x}{a^2}+\frac {2 \sqrt {a-b} \sqrt {a+b} B \tanh ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a^2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.17, size = 61, normalized size = 1.00 \[ \frac {B \left (b (c+d x)-2 \sqrt {a^2-b^2} \tanh ^{-1}\left (\frac {(b-a) \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )\right )}{a^2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.49, size = 197, normalized size = 3.23 \[ \left [\frac {2 \, B b d x + \sqrt {a^{2} - b^{2}} B \log \left (\frac {2 \, a b \cos \left (d x + c\right ) - {\left (a^{2} - 2 \, b^{2}\right )} \cos \left (d x + c\right )^{2} + 2 \, \sqrt {a^{2} - b^{2}} {\left (b \cos \left (d x + c\right ) + a\right )} \sin \left (d x + c\right ) + 2 \, a^{2} - b^{2}}{a^{2} \cos \left (d x + c\right )^{2} + 2 \, a b \cos \left (d x + c\right ) + b^{2}}\right )}{2 \, a^{2} d}, \frac {B b d x + \sqrt {-a^{2} + b^{2}} B \arctan \left (-\frac {\sqrt {-a^{2} + b^{2}} {\left (b \cos \left (d x + c\right ) + a\right )}}{{\left (a^{2} - b^{2}\right )} \sin \left (d x + c\right )}\right )}{a^{2} d}\right ] \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.71, size = 187, normalized size = 3.07 \[ \frac {2 \, {\left (\frac {\sqrt {-a^{2} + b^{2}} {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor + \arctan \left (\frac {\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\sqrt {-\frac {a b + \sqrt {a^{2} b^{2} + {\left (a^{2} + a b\right )} {\left (a^{2} - a b\right )}}}{a^{2} - a b}}}\right )\right )} B {\left | -a + b \right |}}{a^{3} - a^{2} b} + \frac {{\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor + \arctan \left (\frac {\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\sqrt {-\frac {a b - \sqrt {a^{2} b^{2} + {\left (a^{2} + a b\right )} {\left (a^{2} - a b\right )}}}{a^{2} - a b}}}\right )\right )} B b}{a^{2}}\right )}}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 1.03, size = 116, normalized size = 1.90 \[ \frac {2 B \arctanh \left (\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (a -b \right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{d \sqrt {\left (a -b \right ) \left (a +b \right )}}-\frac {2 b^{2} \arctanh \left (\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (a -b \right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right ) B}{d \,a^{2} \sqrt {\left (a -b \right ) \left (a +b \right )}}+\frac {2 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right ) B b}{d \,a^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 2.56, size = 91, normalized size = 1.49 \[ \frac {2\,B\,b\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{a^2\,d}+\frac {2\,B\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2-b^2}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (a+b\right )}\right )\,\sqrt {a^2-b^2}}{a^2\,d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \frac {B \left (\int \frac {b}{a + b \sec {\left (c + d x \right )}}\, dx + \int \frac {a \sec {\left (c + d x \right )}}{a + b \sec {\left (c + d x \right )}}\, dx\right )}{a} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________